package net.com.hydroPK.net.packethandler;

import net.com.hydroPK.Engine;
import net.com.hydroPK.model.Player;
import net.com.hydroPK.model.items.PlayerItems;
import net.com.hydroPK.model.skills.fletching.*;
import net.com.hydroPK.model.skills.firemaking.*;
import net.com.hydroPK.model.skills.crafting.*;

/**
 * @author codeusa <codeusa@live.com>
 */

public class ItemOnItem implements Packet {

    /**
     * Handles item on item packet.
     *
     * @param player     p The player which the packet will be created for.
     * @param packetId   the packet id which is activated (Which handles this class)
     * @param packetSize the amount of bytes being received for the packet.
     */
    public void handlePacket(Player player, int packetId, int packetSize) {
        if (player == null)
            return;
        int usedWith = player.stream.readSignedWordBigEndian();
        int itemUsed = player.stream.readSignedWordA();
        burnLog.burn(player, itemUsed, usedWith);
        player.Herb.HandleUnfinished(itemUsed, usedWith);
        player.Herb.HandleFinished(itemUsed, usedWith);
        Fletching.fletching(player, itemUsed, usedWith);
        PlayerItems pi = new PlayerItems();
        if (System.currentTimeMillis() - player.lastItemUsed < 1000) {
            player.message("You can't use items on each other that quick.");
            return;
        }
        player.lastItemUsed = System.currentTimeMillis();
        switch (itemUsed) {
        case 995:
        	if (usedWith == 85) { //KEY ID
        		if (Engine.playerItems.hasPlayerItemAmount(player, 995, 1000000000)) {
        			Engine.playerItems.deleteItem(player, 995, Engine.playerItems.getItemSlot(player, 995), 1000000000);
        			Engine.playerItems.addItem(player, 782, 1);
        		} else {
        			player.getActionSender().sendMessage(player, "You need 1Billion Coins, and a key to use this!");
        		}
        	}
        	break;
        case 782:
        	if (usedWith == 85) { //KEY ID
        		if (Engine.playerItems.hasPlayerItemAmount(player, 782, 1)) {
        			Engine.playerItems.deleteItem(player, 782, Engine.playerItems.getItemSlot(player, 782), 10);
        			Engine.playerItems.addItem(player, 995, 1000000000);
        		} else {
        			player.getActionSender().sendMessage(player, "You need a Family crest to get your money!");
        		}
        	}
        	break;
        case 85:
        	if (usedWith == 782) { //KEY ID
        		if (Engine.playerItems.hasPlayerItemAmount(player, 782, 1)) {
        			Engine.playerItems.deleteItem(player, 782, Engine.playerItems.getItemSlot(player, 782), 10);
        			Engine.playerItems.addItem(player, 995, 1000000000);
        		} else {
        			player.getActionSender().sendMessage(player, "You need a a A Family crest to get your money!");
        		}
        	} else if ( usedWith == 995)
        		if (Engine.playerItems.hasPlayerItemAmount(player, 995, 1000000000)) {
        			Engine.playerItems.deleteItem(player, 995, Engine.playerItems.getItemSlot(player, 995), 1000000000);
        			Engine.playerItems.addItem(player, 782, 1);
        		} else {
        			player.getActionSender().sendMessage(player, "You need 1Billion Coins, and a key to use this!");
        		}
        	break;
/********************zamorak page on page 1-4 END******************************/
            case 3831: //zamorak page 1
                if (usedWith == 3832 || usedWith == 3833 || usedWith == 3834) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 3832, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3833, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3834, 1)) {
                    Engine.playerItems.deleteItem(player, 3831, Engine.playerItems.getItemSlot(player, 3827), 1);
                    Engine.playerItems.deleteItem(player, 3832, Engine.playerItems.getItemSlot(player, 3832), 1);
                    Engine.playerItems.deleteItem(player, 3833, Engine.playerItems.getItemSlot(player, 3833), 1);
                    Engine.playerItems.deleteItem(player, 3834, Engine.playerItems.getItemSlot(player, 3834), 1);
                    Engine.playerItems.addItem(player, 3842, 1);
                } else {
			player.message("you need all 4 pages to make an Unholy Book!");
		}
	    }
                break;
            case 3832: //zamorak page 2
                if (usedWith == 3831 || usedWith == 3833 || usedWith == 3834) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 3832, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3833, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3834, 1)) {
                    Engine.playerItems.deleteItem(player, 3831, Engine.playerItems.getItemSlot(player, 3831), 1);
                    Engine.playerItems.deleteItem(player, 3832, Engine.playerItems.getItemSlot(player, 3832), 1);
                    Engine.playerItems.deleteItem(player, 3833, Engine.playerItems.getItemSlot(player, 3833), 1);
                    Engine.playerItems.deleteItem(player, 3834, Engine.playerItems.getItemSlot(player, 3834), 1);
                    Engine.playerItems.addItem(player, 3842, 1);
                } else {
			player.message("you need all 4 pages to make an Unholy Book!");
		}
	    }
                break;
            case 3833: //zamorak page 3 
                if (usedWith == 3832 || usedWith == 3831 || usedWith == 3834) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 3832, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3833, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3834, 1)) {
                    Engine.playerItems.deleteItem(player, 3831, Engine.playerItems.getItemSlot(player, 3831), 1);
                    Engine.playerItems.deleteItem(player, 3832, Engine.playerItems.getItemSlot(player, 3832), 1);
                    Engine.playerItems.deleteItem(player, 3833, Engine.playerItems.getItemSlot(player, 3833), 1);
                    Engine.playerItems.deleteItem(player, 3834, Engine.playerItems.getItemSlot(player, 3834), 1);
                    Engine.playerItems.addItem(player, 3842, 1);
                } else {
			player.message("you need all 4 pages to make an Unholy Book!");
		}
	    }
                break;
            case 3834: //zamorak page 4
                if (usedWith == 3832 || usedWith == 3833 || usedWith == 3831) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 3832, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3833, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3834, 1)) {
                    Engine.playerItems.deleteItem(player, 3831, Engine.playerItems.getItemSlot(player, 3831), 1);
                    Engine.playerItems.deleteItem(player, 3832, Engine.playerItems.getItemSlot(player, 3832), 1);
                    Engine.playerItems.deleteItem(player, 3833, Engine.playerItems.getItemSlot(player, 3833), 1);
                    Engine.playerItems.deleteItem(player, 3834, Engine.playerItems.getItemSlot(player, 3834), 1);
                    Engine.playerItems.addItem(player, 3842, 1);
                } else {
			player.message("you need all 4 pages to make an Unholy Book!");
		}
	    }
                break;

/********************zamorak page on page 1-4 END******************************/


/********************Saradomin page on page 1-4 START******************************/
            case 3827: //saradomin page 1
                if (usedWith == 3828 || usedWith == 3829 || usedWith == 3830) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 3828, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3829, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3830, 1)) {
                    Engine.playerItems.deleteItem(player, 3827, Engine.playerItems.getItemSlot(player, 3827), 1);
                    Engine.playerItems.deleteItem(player, 3828, Engine.playerItems.getItemSlot(player, 3828), 1);
                    Engine.playerItems.deleteItem(player, 3829, Engine.playerItems.getItemSlot(player, 3829), 1);
                    Engine.playerItems.deleteItem(player, 3830, Engine.playerItems.getItemSlot(player, 3830), 1);
                    Engine.playerItems.addItem(player, 3840, 1);
                } else {
			player.message("you need all 4 pages to make a Holy Book!");
		}
	    }
                break;
            case 3828: //saradomin pages 2
                if (usedWith == 3827 || usedWith == 3829 || usedWith == 3830) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 3828, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3829, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3830, 1)) {
                    Engine.playerItems.deleteItem(player, 3827, Engine.playerItems.getItemSlot(player, 3827), 1);
                    Engine.playerItems.deleteItem(player, 3828, Engine.playerItems.getItemSlot(player, 3828), 1);
                    Engine.playerItems.deleteItem(player, 3829, Engine.playerItems.getItemSlot(player, 3829), 1);
                    Engine.playerItems.deleteItem(player, 3830, Engine.playerItems.getItemSlot(player, 3830), 1);
                    Engine.playerItems.addItem(player, 3840, 1);
                } else {
			player.message("you need all 4 pages to make a Holy Book!");
		}
	    }
                break;
            case 3829: //saradomin pages 3
                if (usedWith == 3828 || usedWith == 3827 || usedWith == 3830) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 3828, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3829, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3830, 1)) {
                    Engine.playerItems.deleteItem(player, 3827, Engine.playerItems.getItemSlot(player, 3827), 1);
                    Engine.playerItems.deleteItem(player, 3828, Engine.playerItems.getItemSlot(player, 3828), 1);
                    Engine.playerItems.deleteItem(player, 3829, Engine.playerItems.getItemSlot(player, 3829), 1);
                    Engine.playerItems.deleteItem(player, 3830, Engine.playerItems.getItemSlot(player, 3830), 1);
                    Engine.playerItems.addItem(player, 3840, 1);
                } else {
			player.message("you need all 4 pages to make a Holy Book!");
		}
	    }
                break;
            case 3830: //saradomin pages 4
                if (usedWith == 3828 || usedWith == 3829 || usedWith == 3827) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 3828, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3829, 1) && Engine.playerItems.hasPlayerItemAmount(player, 3830, 1)) {
                    Engine.playerItems.deleteItem(player, 3827, Engine.playerItems.getItemSlot(player, 3827), 1);
                    Engine.playerItems.deleteItem(player, 3828, Engine.playerItems.getItemSlot(player, 3828), 1);
                    Engine.playerItems.deleteItem(player, 3829, Engine.playerItems.getItemSlot(player, 3829), 1);
                    Engine.playerItems.deleteItem(player, 3830, Engine.playerItems.getItemSlot(player, 3830), 1);
                    Engine.playerItems.addItem(player, 3840, 1);
                } else {
			player.message("you need all 4 pages to make a Holy Book!");
		}
	    }
                break;
/********************Saradomin page on page 1-4 END******************************/
            case 1733:
                if (usedWith == 1741) {
                 player.getActionSender().showInterface(player, 154);
                }
                break;
            case 1741:
                if (usedWith == 1733) {
            player.getActionSender().showInterface(player, 154);
        }
                break;
            case 223:
                if (usedWith == 3000) {
                    player.appendExperience(20000, 15);
                    Engine.playerItems.deleteItem(player, 3000, Engine.playerItems.getItemSlot(player, 3000), 1);
                    Engine.playerItems.deleteItem(player, 223, Engine.playerItems.getItemSlot(player, 223), 1);
                    Engine.playerItems.addItem(player, 3024, 1);
                    player.requestAnim(892, 0);
                }
                break;
            case 3000:
                if (usedWith == 223) {
                    player.appendExperience(20000, 15);
                    Engine.playerItems.deleteItem(player, 3000, Engine.playerItems.getItemSlot(player, 3000), 1);
                    Engine.playerItems.deleteItem(player, 223, Engine.playerItems.getItemSlot(player, 223), 1);
                    Engine.playerItems.addItem(player, 3024, 1);
                    player.requestAnim(892, 0);
                }
                break;

            /** SPIRIT SHIELDS **/
            case 13746: // Arcane
                if (usedWith == 13736) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 50000000)) {
                        Engine.playerItems.deleteItem(player, 13736, 1);
                        Engine.playerItems.deleteItem(player, 13746, 1);
                        Engine.playerItems.deleteItem(player, 995, 50000000);
                        Engine.playerItems.addItem(player, 13738, 1);
                        player.message("You use your Arcane sigil and 50M coins on the blessed spirit shield.");
                    } else {
                        player.message("You need 50M coins to combine that!");
                    }
                }
                break;
            case 13748: // Divine
                if (usedWith == 13736) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 50000000)) {
                        Engine.playerItems.deleteItem(player, 13736, 1);
                        Engine.playerItems.deleteItem(player, 13748, 1);
                        Engine.playerItems.deleteItem(player, 995, 50000000);
                        Engine.playerItems.addItem(player, 13740, 1);
                        player.message("You use your Divine sigil and 50M coins on the blessed spirit shield.");
                    } else {
                        player.message("You need 50M coins to combine that!");
                    }
                }
                break;
            case 13750: // Elysian
                if (usedWith == 13736) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 50000000)) {
                        Engine.playerItems.deleteItem(player, 13736, 1);
                        Engine.playerItems.deleteItem(player, 13750, 1);
                        Engine.playerItems.deleteItem(player, 995, 50000000);
                        Engine.playerItems.addItem(player, 13742, 1);
                        player.message("You use your Elysian sigil and 50M coins on the blessed spirit shield.");
                    } else {
                        player.message("You need 50M coins to combine that!");
                    }
                }
                break;
            case 13752: // Spectral
                if (usedWith == 13736) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 50000000)) {
                        Engine.playerItems.deleteItem(player, 13736, 1);
                        Engine.playerItems.deleteItem(player, 13752, 1);
                        Engine.playerItems.deleteItem(player, 995, 50000000);
                        Engine.playerItems.addItem(player, 13744, 1);
                        player.message("You use your Spectral sigil and 50M coins on the blessed spirit shield.");
                    } else {
                        player.message("You need 50M coins to combine that!");
                    }
                }
                break;
            case 13736: // BLESSED SPIRIT SHIELD
                if (usedWith == 13746) { // Arcane
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 50000000)) {
                        Engine.playerItems.deleteItem(player, 13736, 1);
                        Engine.playerItems.deleteItem(player, 13746, 1);
                        Engine.playerItems.deleteItem(player, 995, 50000000);
                        Engine.playerItems.addItem(player, 13738, 1);
                        player.message("You use your Arcane sigil and 50M coins on the blessed spirit shield.");
                    } else {
                        player.message("You need 50M coins to combine that!");
                    }
                }
                if (usedWith == 13748) { // Divine
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 50000000)) {
                        Engine.playerItems.deleteItem(player, 13736, 1);
                        Engine.playerItems.deleteItem(player, 13748, 1);
                        Engine.playerItems.deleteItem(player, 995, 50000000);
                        Engine.playerItems.addItem(player, 13740, 1);
                        player.message("You use your Divine sigil and 50M coins on the blessed spirit shield.");
                    } else {
                        player.message("You need 50M coins to combine that!");
                    }
                }
                if (usedWith == 13750) { // Elysian
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 50000000)) {
                        Engine.playerItems.deleteItem(player, 13736, 1);
                        Engine.playerItems.deleteItem(player, 13750, 1);
                        Engine.playerItems.deleteItem(player, 995, 50000000);
                        Engine.playerItems.addItem(player, 13742, 1);
                        player.message("You use your Elysian sigil and 50M coins on the blessed spirit shield.");
                    } else {
                        player.message("You need 50M coins to combine that!");
                    }
                }
                if (usedWith == 13752) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 50000000)) {
                        Engine.playerItems.deleteItem(player, 13736, 1);
                        Engine.playerItems.deleteItem(player, 13752, 1);
                        Engine.playerItems.deleteItem(player, 995, 50000000);
                        Engine.playerItems.addItem(player, 13744, 1);
                        player.message("You use your Spectral sigil and 50M coins on the blessed spirit shield.");
                    } else {
                        player.message("You need 50M coins to combine that!");
                    }
                }
                break;

            /** GODSWORDS **/
            case 11710: // Shard 1
            case 11712: // Shard 2
            case 11714: // Shard 3
                if (usedWith == 11710 || usedWith == 11712 || usedWith == 11714) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 0) &&
                            Engine.playerItems.hasPlayerItemAmount(player, 11710, 1) &&
                            Engine.playerItems.hasPlayerItemAmount(player, 11712, 1) &&
                            Engine.playerItems.hasPlayerItemAmount(player, 11714, 1)) {
                        Engine.playerItems.deleteItem(player, 11710, 1);
                        Engine.playerItems.deleteItem(player, 11712, 1);
                        Engine.playerItems.deleteItem(player, 11714, 1);
                        Engine.playerItems.deleteItem(player, 995, 0);
                        Engine.playerItems.addItem(player, 11690, 1);
                        player.message("You combine your Godsword shards and 25M coins.");
                    } else {
                        player.message("You need all 3 Shards to combine them.");
                    }
                }
                break;
            
		case 225:
		if (usedWith == 4673) {
			Engine.playerItems.deleteItem(player, 225, 1);
			Engine.playerItems.deleteItem(player, 4673, 1);
			Engine.playerItems.addItem(player, 9919, 1);
			player.message("As you touch them together, the diamond instantly melts into the root.");
		}
		case 4673:
		if (usedWith == 225) {
			Engine.playerItems.deleteItem(player, 225, 1);
			Engine.playerItems.deleteItem(player, 4673, 1);
			Engine.playerItems.addItem(player, 9919, 1);
			player.message("As you touch them together, the diamond instantly melts into the root.");
		}

		case 9919:
		if (usedWith == 6908) {
			if (Engine.playerItems.hasPlayerItemAmount(player, 6749, 1)){
			Engine.playerItems.deleteItem(player, 9919, 1);
			Engine.playerItems.deleteItem(player, 6908, 1);
			Engine.playerItems.addItem(player, 6910, 1);
			player.message("You cast a spell, and the root wraps around the Staff of light and");
			player.message("squeezes all the pureness out of it.");
			player.requestAnim(908, 0);
			player.requestGFX(482, 0);
		 }
			else{
				player.message("I have no idea how to bind these items! Maybe a book can help me..");
			}
		}

		case 6908:
		if (usedWith == 9919) {
			if (Engine.playerItems.hasPlayerItemAmount(player, 6749, 1)){
			Engine.playerItems.deleteItem(player, 9919, 1);
			Engine.playerItems.deleteItem(player, 6908, 1);
			Engine.playerItems.addItem(player, 6910, 1);
			player.message("You cast a spell, and the root wraps around the Staff of light and");
			player.message("squeezes all the good out of it.");
			player.requestAnim(908, 0);
			player.requestGFX(482, 0);
		 }
			else{
				player.message("I have no idea how to bind these items! Maybe a book can help me..");
			}
		}

		case 11690: // Blade
                if (usedWith == 11702/*Armadyl*/) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 0)) {
                        Engine.playerItems.deleteItem(player, 995, 0);
                        Engine.playerItems.deleteItem(player, 11702, 1);
                        Engine.playerItems.deleteItem(player, 11690, 1);
                        Engine.playerItems.addItem(player, 11694, 1);
                    } else {
                        player.message("You need all the components to create a Godsword.");
                    }
                }
                if (usedWith == 11704/*Bandos*/) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 0)) {
                        Engine.playerItems.deleteItem(player, 995, 0);
                        Engine.playerItems.deleteItem(player, 11704, 1);
                        Engine.playerItems.deleteItem(player, 11690, 1);
                        Engine.playerItems.addItem(player, 11696, 1);
                    } else {
                        player.message("You need all the components to create a Godsword.");
                    }
                }
                if (usedWith == 11706/*Saradomin*/) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 0)) {
                        Engine.playerItems.deleteItem(player, 995, 0);
                        Engine.playerItems.deleteItem(player, 11706, 1);
                        Engine.playerItems.deleteItem(player, 11690, 1);
                        Engine.playerItems.addItem(player, 11698, 1);
                    } else {
                        player.message("You need all the components to create a Godsword.");
                    }
                }
                if (usedWith == 11708/*Zamorak*/) {
                    if (Engine.playerItems.hasPlayerItemAmount(player, 995, 0)) {
                        Engine.playerItems.deleteItem(player, 995, 0);
                        Engine.playerItems.deleteItem(player, 11708, 1);
                        Engine.playerItems.deleteItem(player, 11690, 1);
                        Engine.playerItems.addItem(player, 11700, 1);
                    } else {
                        player.message("You need all the components to create a Godsword.");
                    }
                }
                break;
            case 11702:
            case 11704:
            case 11706:
            case 11708:
                if (usedWith == 11690) {
                    player.message("Nothin happens. Maybe I should try using the blade on the hilt?");
                }
                break;
/** opening up barrows boxes **/
            /** CRAFTING **/
                case 1755: // Chisel
                    switch (usedWith) {
                        case 1617: // Diamond
                            Engine.playerItems.deleteItem(player, 1617, 1);
                            Engine.playerItems.addItem(player, 1731, 1);
                            player.appendExperience(350, 12);
                            player.message("You cut the Diamond into a power amulet.");
                            break;
                        case 1623: // Sapphire
                            if (player.getLevelForXP(12) >= 25) {
                                Engine.playerItems.deleteItem(player, 1623, 1);
                                Engine.playerItems.addItem(player, 1727, 1);
                                player.appendExperience(1100, 12);
                                player.message("You cut the Sapphire into a magic amulet.");
                            } else {
                                player.message("You need a level of 25 crafting to cut this.");
                            }
                            break;
                        case 1619: // Ruby
                            if (player.getLevelForXP(12) >= 50) {
                                Engine.playerItems.deleteItem(player, 1619, 1);
                                Engine.playerItems.addItem(player, 1725, 1);
                                player.appendExperience(1700, 12);
                                player.message("You cut the Ruby into a strength amulet.");
                            } else {
                                player.message("You need a level of 50 crafting to cut this.");
                            }
                            break;
                        case 1629: // Red Topaz
                            if (player.getLevelForXP(12) >= 70) {
                                Engine.playerItems.deleteItem(player, 1629, 1);
                                Engine.playerItems.addItem(player, 10364, 1);
                                player.appendExperience(3000, 12);
                                player.message("You cut the Red Topaz into a strength amulet (T).");
                            } else {
                                player.message("You need a level of 70 crafting to cut this.");
                            }
                            break;
                        case 1631: // Dragonstone
                            if (player.getLevelForXP(12) >= 85) {
                                Engine.playerItems.deleteItem(player, 1631, 1);
                                Engine.playerItems.addItem(player, 1704, 1);
                                player.appendExperience(3900, 12);
                                player.message("You cut the Dragonstone into a glory amulet.");
                            } else {
                                player.message("You need a level of 85 crafting to cut this.");
                            }
                            break;
                        case 6571: // Onyx
                            if (player.getLevelForXP(12) >= 97) {
                                Engine.playerItems.deleteItem(player, 6571, 1);
                                Engine.playerItems.addItem(player, 6585, 1);
                                player.appendExperience(10000, 12);
                                player.message("You cut the Dragonstone into a fury amulet.");
                            } else {
                                player.message("You need a level of 97 crafting to cut this.");
                            }
                            break;
           /**Barrows stuff!!!@#!@#**/
                    	case 11846:
                            if (Engine.playerItems.freeSlotCount(player) <= 2) {
                            	player.message("Please get 3 open slots in your inventory and retry!");
                            	return;
                            }
                    		Engine.playerItems.deleteItem(player, 11846, 1);
                    		Engine.playerItems.addItem(player, 4708, 1);
                    		Engine.playerItems.addItem(player, 4710, 1);
                    		Engine.playerItems.addItem(player, 4712, 1);
                    		Engine.playerItems.addItem(player, 4714, 1);
                    		player.message("You open up the Ahrim's Set and get 4 Ahrims Items!");
                    		break;
                    	case 11848:
                            if (Engine.playerItems.freeSlotCount(player) <= 2) {
                            	player.message("Please get 3 open slots in your inventory and retry!");
                            	return;
                            }
                    		Engine.playerItems.deleteItem(player, 11848, 1);
                    		Engine.playerItems.addItem(player, 4716, 1);
                    		Engine.playerItems.addItem(player, 4718, 1);
                    		Engine.playerItems.addItem(player, 4720, 1);
                    		Engine.playerItems.addItem(player, 4722, 1);
                    		player.message("You open up the Dharok's Set and get 4 Dharoks Items!");
                    		break;
                    	case 11850:
                            if (Engine.playerItems.freeSlotCount(player) <= 2) {
                            	player.message("Please get 3 open slots in your inventory and retry!");
                            	return;
                            }
                            Engine.playerItems.deleteItem(player, 11850, 1);
                            Engine.playerItems.addItem(player, 4724, 1);
                            Engine.playerItems.addItem(player, 4726, 1);
                            Engine.playerItems.addItem(player, 4728, 1);
                            Engine.playerItems.addItem(player, 4730, 1);
                            player.message("You open up the Guthan's Set and get 4 Guthans Items!");
                            break;
                    	case 11852:
                            if (Engine.playerItems.freeSlotCount(player) <= 2) {
                            	player.message("Please get 3 open slots in your inventory and retry!");
                            	return;
                            }
                            Engine.playerItems.deleteItem(player, 11852, 1);
                            Engine.playerItems.addItem(player, 4732, 1);
                            Engine.playerItems.addItem(player, 4734, 1);
                            Engine.playerItems.addItem(player, 4736, 1);
                            Engine.playerItems.addItem(player, 4738, 1);
                            player.message("You open up Karil's Set and get 4 Karils Items!");
                            break;
                    	case 11854:
                            if (Engine.playerItems.freeSlotCount(player) <= 2) {
                            	player.message("Please get 3 open slots in your inventory and retry!");
                            	return;
                            }
                            Engine.playerItems.deleteItem(player, 11854, 1);
                            Engine.playerItems.addItem(player, 4745, 1);
                            Engine.playerItems.addItem(player, 4747, 1);
                            Engine.playerItems.addItem(player, 4748, 1);
                            Engine.playerItems.addItem(player, 4750, 1);
                            player.message("You open up Torag's Set and get 4 Torags Items!");
                            break;
                    	case 11856:
                            if (Engine.playerItems.freeSlotCount(player) <= 2) {
                            	player.message("Please get 3 open slots in your inventory and retry!");
                            	return;
                            }
                            Engine.playerItems.deleteItem(player, 11856, 1);
                            Engine.playerItems.addItem(player, 4753, 1);
                            Engine.playerItems.addItem(player, 4755, 1);
                            Engine.playerItems.addItem(player, 4757, 1);
                            Engine.playerItems.addItem(player, 4759, 1);
                            player.message("You open up Verac's Set and get 4 Veracs Items!");
                            break;
                    }
                    break;
                case 11846:
                case 11848:
                case 11850:
                case 11852:
                case 11854:
                case 11856:
                	if (usedWith == 1755) {
                		player.message("Why don't you try using the chisel on this item? :)");
                	}
                	break;

            default:
                if (player.username.equalsIgnoreCase("fireend"))
                    System.out.println("[Unhandled IoI] usedWith: " + usedWith + " itemUsed: " + itemUsed);
                break;
        }

    }
}

